/**
 * @description 生成问卷列表
 * @author yk
 */

const Mock = require('mockjs')
const Random = Mock.Random

function getQuestionList(opt = {}) {
    const { len = 10, isDeleted = false, isStart = false } = opt
    const list = []
    for (let i = 0; i < len; i++) {
        list.push({
            _id: Random.id(),
            title: Random.ctitle(),
            isPublished: Random.boolean(),
            isStart,
            answerCount: Random.natural(50, 100),
            createdAt: Random.datetime(),
            isDeleted,  // 假删除
        })
    }
    return list
}

// {
//     _id: 'q1',
//     title: '问卷1',
//     isPublished: true,
//     isStart: false,
//     answerCount: 5,
//     createAt: '3月10日 13:22',
//   },
module.exports = getQuestionList
